<?php include('config.php') ?>
<?php
session_start();
$sql = "SELECT * FROM `survey` WHERE `instructor_ID`='".$_SESSION['user_ID']."'";
$data = mysql_query($sql) or die('Error completing query: '.mysql_error());

echo "<table>";
echo "<tr>";
echo "<th>Course</th>";
echo "<th>Survey</th>";
echo "</tr>";
while($info = mysql_fetch_array( $data))
{
    echo "<tr>";
    echo "<td>".$info['course_name']."</td>";
    echo "<td>".$info['survey_name']."</td>";
    
    echo "<td><a href=\"survey_results.php?ID=".$info['ID']."\">View Results</a>";
    echo "<td><a href=\"edit_survey.php?survey_ID=".$info['ID']."\">Add Questions</a>";
    echo "<td><a href=\"#\" onClick=\"delete_survey(".$info['ID'].")\">Delete</a>";
}
echo "</table>";
?>